﻿using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using MvcForum.Data;

namespace MvcForum.Models
{
    class UserValidator
    {
        public static bool isValidUser(MvcForum.Data.User usr)
        {
            if (string.IsNullOrEmpty(usr.UserName) || usr.UserName.Length > 50)
            {
                return false;
            }

            if (string.IsNullOrEmpty(usr.Password) || usr.Password.Length != 32)
            {
                return false;
            }

            if (string.IsNullOrEmpty(usr.UserEmail))
            {
                return false;
            }

            return true;
        }
    }
}